from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime

class SearchInputRecordBase(BaseModel):
    text: Optional[str] = None
    context: Optional[str] = None
    answer: Optional[str] = None
    ip: Optional[str] = None
    username: Optional[str] = None

class SearchInputRecord(SearchInputRecordBase):
    id: int
    create_time: datetime

    class Config:
        from_attributes = True

class PaginatedResponse(BaseModel):
    total: int
    items: List[SearchInputRecord]
    page: int
    page_size: int 